<?php

include_once 'common_mbs.inc.php';
include_once './smarty.inc.php';


$d = strtotime('2013-1-1');

$time = $d;
$date_count = date('t',$time);
$ym		= date('Y-m',$time);
$data_content = array();
$start_week=date('w',strtotime($ym.'-1'));
$last_week= 6 - date('w',strtotime($ym.'-'.$date_count));
$now = time() - 86400;
for($i = 1; $i <= $date_count;$i++)
{
	$day = $ym.'-'.$i;
	$time = strtotime($day);
	$week=date('w',$time);
	if( $now >= $time)
	{
		$data_content[$i]['status'] = 0;
	}
	else
	{
		$data_content[$i]['status'] = 1;
	}	
	$data_content[$i]['room'] = 1;
	$data_content[$i]['week'] = $week;	
	$data_content[$i]['date'] = $day;
}

$smarty->assign('last_week', $last_week);
$smarty->assign('start_week', $start_week);
$smarty->assign('data_content', $data_content);
$smarty->assign('date_count', $date_count);
$smarty->display('date.tpl');
?>
